import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Vant from 'vant';
import 'vant/lib/index.css';
import axios from "axios";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

// import 'vue-video-player/src/custom-theme.css'
// import 'video.js/dist/video-js.css'
Vue.directive('title', {
  inserted: function (el, binding) {
    document.title = el.dataset.title
  }
})
Vue.config.productionTip = false
Vue.use(Vant);
Vue.use(ElementUI);
localStorage.setItem("system","领航");
//云养
// axios.interceptors.request.use(function (config) {
//   let r1 = config.url.startsWith('/');
//   if(r1){
//     config.url = "https://yumyoung.com/api"+config.url
//   }else{
//     config.url = "https://yumyoung.com/api/"+config.url
//   }
//   return config
// }, function (error) {
//   return Promise.reject(error)
// })
// 领航
axios.interceptors.request.use(function (config) {
  let r1 = config.url.startsWith('/');
  if(r1){
    config.url = "http://lh.yumyoung.com/api"+config.url
  }else{
    config.url = "http://lh.yumyoung.com/api/"+config.url
  }
  return config
}, function (error) {
  return Promise.reject(error)
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
